package com.zxpt.quetion.common;


import lombok.Data;

/**
* 所在包：com.wenhe.trans.common
* 文件名：
* 版权：稻草人.
* 项目：trans
* 功能描述：
* 修改人：Wenhe
* 修改时间：2019-12-25 14:42
*/
@Data
public class Result<T> {

    public Boolean result;

    public Integer code;

    public T data;

    public String msg;

    public void success() {
        result = true;
    }

    public void success(String msg) {
        result = true;
        this.msg = msg;
    }

    public void error(String msg) {
        result = false;
        this.msg = msg;
    }

    public void error(Integer code) {
        result = false;
        this.code = code;
    }

    public void error(String msg, Integer code) {
        result = false;
        this.msg = msg;
        this.code = code;
    }
}
